import request from "@pangza-club/utils/axios";

export function getSubjectInfoPage(data: PageRequest<SubjectPageDTO>) {
    return request.post<PageResult<Subject>>('/api/subject/page', data);
}

export function getSubjectInfo(id: number) {
    return request.get<SubjectVO>('/api/subject/' + id);
}

export function getNewsSubject() {
    return request.get<SubjectVO[]>('/api/subject/news');
}

export function getSimilarList(id: number) {
    return request.get<SubjectVO[]>('/api/subject/similar/' + id)
}

export function getSubjectByLabel(data: PageRequest<GetSubjectByLabelDTO>) {
    return request.post<PageResult<SubjectVO>>('/api/subject/page_label', data);
}

export function getSubjectCharts() {
    return request.get<UserCharts[]>('/api/subject/subject/charts');
}